#import "KineticElevateController.h"
        
#import "KineticElevateModel.h"
#import "KineticElevateCell.h"
#import "Masonry.h"

@interface KineticElevateController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *graciousCollectionView;
@property (nonatomic, strong) NSMutableArray *infiniteMergeTerrainArr;

@end

@implementation KineticElevateController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self plumeConfigsui];
	[self wispEnchantingfetchData];
}


- (UICollectionView *)graciousCollectionView {
    if (!_graciousCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _graciousCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _graciousCollectionView.backgroundColor = UIColor.clearColor;
        _graciousCollectionView.delegate = self;
        _graciousCollectionView.dataSource = self;
        _graciousCollectionView.showsHorizontalScrollIndicator = NO;
        _graciousCollectionView.showsVerticalScrollIndicator = NO;
        [_graciousCollectionView registerClass:[KineticElevateCell class] forCellWithReuseIdentifier:NSStringFromClass([KineticElevateCell class])];
    }
    return _graciousCollectionView;
}

//: 初始化页面UI
- (void)plumeConfigsui {
	[self.view addSubview:self.graciousCollectionView];
	[self.graciousCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


//: 获取数据模型
- (void)wispEnchantingfetchData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)infiniteMergeTerrainArr {
	if (!_infiniteMergeTerrainArr) {
		_infiniteMergeTerrainArr = [NSMutableArray array];
	}
	return _infiniteMergeTerrainArr;
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.infiniteMergeTerrainArr.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    KineticElevateCell *libertyNebulaOnyx = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([KineticElevateCell class]) forIndexPath:indexPath];
    return libertyNebulaOnyx;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
